import { getData, postData } from '../../untils/request';

// 获取文章
export async function getArticles(userId, page, size) {
    const articles = await getData(`/article/getAll/${userId}/${page}/${size}`);
    return articles;
}

// 登录
export async function wxLogin(url) {
    const data = await getData(url);
    return data;
}

// 找到已经存在的分类
export async function getCategory() {
  const data = await getData(`/category/getCategory`);
  return data;
}

// 通过分类查找文章
export async function getArticleByCategory(title, userId, page, size) {
  const data = await getData(`/article/getAllByCategory/${title}/${userId}/${page}/${size}`);
  return data;
}

// 通过用户查找关注者文章
export async function getArticleByUser(userId) {
  const data = await getData(`/article/getAllByUser/${userId}`);
  return data;
}
